home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1992-01-31 | 1.8 KB | 55 lines | [ TEXT/ttxt]
Report Error 31 January 1992 Greg Anderson User Programming Group Apple Computer, Inc. greggor@apple.com This is the third release of the ReportError debugging routines. It fixes a bug that caused a crash on Quadras. This folder contains useful debugging routines that converts an OSErr into a pascal-format string and displays it in a dialog box. All result codes from IM-I to IM-VI are included. The messages reported are a bit too criptic to use for reporting errors to end users, but I have found them to be VERY convenient for development. API: There are two routines that you may wish to use: pascal Boolean FindResultCodeDescription( OSErr theErr, Str255 errorNameStr, Str255 errorDescStr ) Given an OSErr, FindResultCodeDescription looks up the name of the error (e.g. memFullErr) and a short discription of what went wrong. pascal void ReportError( Str255 errorMsg, OSErr theErr ) ReportError puts up a dialog box that displays an error message describing the error that was passed in. If theErr is noErr, ReportError does nothing. Using ReportError with THINK C: 1. Copy the resources from ReportError.π.rsrc into your project's resource fork 2. Add ReportError.π to your project (or add reportError.c, dialogUtilities.c and stringUtilities.c to your project) 3. Include reportError.h in any file that calls ReportError Using ReportError with MPW: 1. Copy the 'include' line from ReportError.r into your project's .r file 2. Add ReportError.o to your project's makefile 3. Include reportError.h in any file that calls ReportError Source code is included for the curious. The files 'dialogUtilities.c' and 'stringUtilities.c' might even contain some useful code--you never know. Send questions, comments, and (best of all) fan mail to the author at: greggor@apple.com